import axiosInstance from '../../../tools/request'


//获取验证码
export const getCaptcha = () => {
  return axiosInstance({
    url: `/captcha`,
    method: 'get'
  })
}

//登录用户
export const loginSysUser = (loginForm: any) => {
  return axiosInstance({
    url: `/login`,
    method: 'post',
    data: loginForm
  })
}

//注册用户
export const registerSysUser = (registerForm: any) => {
  return axiosInstance({
    url: `/register`,
    method: 'post',
    data: registerForm
  })
}

//获取全局的缓存
export const applicationCache = () => {
  return axiosInstance({
    url: '/sysDatabaseCache',
    method: 'get'
  })
}

//退出登录
export const logout = () => {
  localStorage.clear()
  return axiosInstance({
    url: '/logout',
    method: 'get'
  })
}
